#ifndef BLUETOOTHDEVICEFUNC_H
#define BLUETOOTHDEVICEFUNC_H

#include <QIcon>
#include <QMenu>
#include <QTimer>
#include <QDebug>
#include <QObject>
#include <QPalette>
#include <QDateTime>
#include <QMessageBox>
#include <QPushButton>
#include <QApplication>
#include <QGSettings/QGSettings>

#include "devicebase.h"
#include "devrenamedialog.h"
#include "devremovedialog.h"
//#include "bluetoothmainwindow.h"
#include "bluetoothdbusservice.h"

#include "windowmanager/windowmanager.h"

#define  ICON_PATH_NAME "view-more-horizontal-symbolic"

class bluetoothdevicefunc : public QPushButton
{
    Q_OBJECT

public:
    bluetoothdevicefunc(QWidget *parent ,QString dev_address);
    ~bluetoothdevicefunc();

    void initGsettings();
    void initInterface();
    void initBackground();
signals:
    void devFuncOpertionSignal();
    void devFuncOpertionRemoveSignal(QString);
    void devBtnReleaseSignal();
private slots:
    void MenuSignalDeviceFunction(QAction *action);
    void mStyle_GSettingsSlot(const QString &key);
    void MenuSignalAboutToHide();
protected:
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
private:


    QMenu   * devMenuFunc           = nullptr;
    QGSettings * _mStyle_GSettings  = nullptr;
    QString     _MDev_addr         ;
    bool        _themeIsBlack = false;
    QString     _mIconThemeName;

    long long _pressCurrentTime;

    void showDeviceRenameWidget();
    void showDeviceRemoveWidget(DevRemoveDialog::REMOVE_INTERFACE_TYPE mode);
};


#endif // BLUETOOTHDEVICEFUNC_H
